package book;

public class BookList {
    private Book[] books = new Book[10];
    private int useSize;//有效的数据个数，也就是放的书的个数。

    //对于书架来说，当有了书架后，那么书架就会有一些基本的书
    //所以对于书架要有一个构造方法，来进行书架的初始书的初始化
    public BookList() {
        this.books[0] = new Book("《大学》","曾子",30,"散文");
        this.books[1] = new Book("《孟子》","孟子",25,"散文");
        this.books[2] = new Book("《中庸》","子思",35,"散文");
        this.books[3] = new Book("《礼记》","戴圣",40,"散文");

        this.useSize = 4;
    }

    public Book[] getBooks() {
        return books;
    }
    public Book getBooks(int pos) {
        return books[pos];
    }

    public void setBooks(int pos,Book book) {
        this.books[pos] = book;
    }

    public int getUseSize() {
        return useSize;
    }

    public void setUseSize(int useSize) {
        this.useSize = useSize;
    }
}
